package multiplexClass;

class WaterSource{
	private String s;
	public WaterSource() {
		System.out.println("WaterSource()");
		s = "Constructed";
	}
	@Override
	public String toString(){
		return s;
	}
}
public class SprinklerSystem {
	private String value1,value2,value3,value4;
	private WaterSource source = new WaterSource();
	private int i;
	private float f;
	public String toString(){
		return 
		"value1 =" + value1 +" " +
		"value2 =" + value2 +" " +
		"value3 =" + value3 +" " +
		"value4 =" + value4 +"\n"+
		"i =" + i + "f = " + f +" " +
		"Source =" + source;
	}
	
	public static void main(String[] args){
		SprinklerSystem sprinklers = new SprinklerSystem();
		/*
		 *直接打印一个对象的引用，也就是调用相应对象的toString方法 
		 */
		System.out.println(sprinklers);
	}
}
